Skip to content

feat: implement create_event storage logic#255

Merged
Akshola00 merged 1 commit intoWeb3Novalabs:mainfrom
whiteghost0001:Implement-create_event-storage-logic
Mar 28, 2026
Merged

feat: implement create_event storage logic#255
Akshola00 merged 1 commit intoWeb3Novalabs:mainfrom
whiteghost0001:Implement-create_event-storage-logic

Conversation

@whiteghost0001
Copy link
Copy Markdown
Contributor

@whiteghost0001 whiteghost0001 commented Mar 26, 2026

Closes #188


i Added EventMetrics struct (with tickets_sold: u32) and two new StorageKey variants (Event, EventMetrics) to types.rs
Updated EventDetails to use BytesN<32> for id and added a token field
Filled in the create_event stub in crowdfunding.rs to actually persist EventDetails and a zero-initialized EventMetrics to contract storage
Added a test that calls create_event and reads back from env.storage() to verify every field is saved correctly and tickets_sold starts at 0

- Add EventMetrics struct with tickets_sold field (zero-initialized)
- Add StorageKey::Event(BytesN<32>) and StorageKey::EventMetrics(BytesN<32>)
- Update EventDetails: id changed to BytesN<32>, added token field
- Implement create_event to persist EventDetails and EventMetrics in storage
- Add state logic test verifying all fields saved correctly in env.storage()
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@whiteghost0001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Akshola00 Akshola00 merged commit f7c5123 into Web3Novalabs:main Mar 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement create_event storage logic

2 participants